package javabook.ch05;

class Jv_5_7_1 { 
	
	public void sub1(){
		System.out.println("--- no argument ---"); 
		System.out.println("Welcome to JAVA!"); 
		System.out.println("JAVA is very fun!\n"); 
	} 
	public void sub2(int a, int b){
		int c; 
		c = a+b; 
		System.out.println("--- argument & no return ---"); 
		System.out.println(a + "+" + b + "=" + c); 
	} 
	public float sub3(int m, int n) {
		float k; 
		k = m+n; 
		System.out.println("--- argument & return ---"); 
		System.out.println(m + "+" + n + "=" + k); 
		return k; 
	} 
} 

class Jv_5_7 { 
	public static void main(String[] args) { 
		int x, y; 
		float w, z; 

		System.out.println("***** no method result *****"); 
		System.out.println("Welcome to JAVA!"); 
		System.out.println("JAVA is very fun!\n"); 
		System.out.print("\n\n"); 

		Jv_5_7_1 ken = new Jv_5_7_1();
		System.out.println("***** method result *****"); 
		
		ken.sub1(); 

		x=30; 
		y=50; 
		
		
		ken.sub2(x, y); 

		w = ken.sub3(x,y); 
		z=w+100; 
		System.out.println("sub3(x,y)=" + w + ", z=" + z); 
	} 
} 

